package moxl.parser.assemblers.xmldecl;

import java.util.EnumMap;
import java.util.Map;

import moxl.parser.assemblers.AbstractAssemblerContext;
import moxl.tokenizer.Token;
import moxl.tokenizer.TokenStream;

public class XmlDeclarationAssemblerContext extends AbstractAssemblerContext<XmlDeclarationAssemblerState>
{
	private final Map<XmlDeclarationBookmark, Token> bookmarkedTokens = new EnumMap<XmlDeclarationBookmark, Token>(XmlDeclarationBookmark.class);
	private char seenQuote;

	public XmlDeclarationAssemblerContext(TokenStream tstream)
	{
		super(tstream, XmlDeclarationAssemblerState.START);
	}

	public void bookmarkToken(XmlDeclarationBookmark bookmark)
	{
		bookmarkedTokens.put(bookmark, getToken());
	}

	public Token getBookmarkedToken(XmlDeclarationBookmark bookmark)
	{
		return bookmarkedTokens.get(bookmark);
	}

	public void setSeenQuote(char c)
	{
		this.seenQuote = c;
	}

	public char getSeenQuote()
    {
	    return seenQuote;
    }

	@Override
    public boolean isNotFinished()
    {
	    return getState() != XmlDeclarationAssemblerState.END;
    }

}
